import sys
import numpy as np
import pdb

class StaticFns:

    @staticmethod
    def termination_fn(obs, act, next_obs):
        assert len(obs.shape) == len(next_obs.shape) == len(act.shape) == 2

        pos = obs[:, -2:]
        dist = ((pos ** 2).sum(axis=1)) ** 0.5
        done = dist > 1000

        done = done[:, None]
        return done
